Skip list create - Anyone help me

I want to add a skip list to this DXL, but i don't get it and I can't figure it out...I'm attaching the code that YOU use to update and create the objects. All I want to do is put a skip list in where if New/updated objects UC_ID_QUID = the HEADING UC_ID_QUID of the object heading move it under it...got any ideas?
SystemAdmin - Wed Mar 27 16:07:40 EDT 2013

Re: Skip list create - Anyone help me
llandale - Thu Mar 28 13:38:36 EDT 2013

Huh? Do I understand correctly?
 

  1. The code loops through the "Operational" requirements module and makes sure that there is indeed a corresponding requirement in the "SubSystem" module. Existing matches are updated if needed; new Ops reqs force new SubSystem objects to be created. Thus, when the powers that be update the Ops, you have a working SubSystem spec.
  2. I see new requirements are created at the bottom of the SubSystem spec and I think you want these created near related requirements, in this case those with same UC_ID_QUID.


If so...

Before your "for o in entire m do" loop, do this:

 

Skip skpQUID = createString() // KEY: 'string' UC_ID_QUID; DATA: last 'Object' with that value
for oReq in entire mReq do
{  if (!isDeleted(oReq))
   {  QUID = oReq."QUID"
      if (find(skpQUID, QUID))
      {  delete(skpQUID, QUID))   // Remove the previous "last" object with that value
      }
      put(skpQUID, QUID, oReq)    // This is the "last" one found with QUID, so far
   }
}


You now have a Skip list of the last oReq with all the various QUIDs. At the bottom before you create the object:

 

 

find(skpQUID, QUID, oReq)


That line of code does this:

 

 

  • If (the Ops QUID exists in the SubSystem spec) //
  • then oReq now points to the last such object.


You can now proceed to create the new SubSystem requirement "after" oReq.

-Louie

Notes:

 

 

 

 

Skip skpSubReqID = createString() // key 'string' ReqID; DATA: 'Object' with that reqID
for oReq in mReq do
{  if (isDeleted(oReq))   continue
   ReqID = oReq."QUID"
   if (!null Req) put(skpSubReqID, ReqID, oReq)
}
// Later:
for o in m
{  if (find(skpReqID, ReqID, oReq))
   then found a match
   else need new Requirement
}

 

Re: Skip list create - Anyone help me
SystemAdmin - Thu Mar 28 18:49:45 EDT 2013

Thank you so much for your response. I will try this tomorrow.

Re: Skip list create - Anyone help me
bellincm - Fri Jun 14 14:43:03 EDT 2013

I need some more help with this code.   The help that I need is still with the placement of the objects when they are created. I want the new objects to be created under the first instance of the heading where the Use Case ID matches with the new Use Case ID. Any thoughts?  Again, it's been a while since I've had to modify DXL code.


Attachments

update_subsystem_requirements_2.dxl

Re: Skip list create - Anyone help me
llandale - Fri Jun 14 17:11:07 EDT 2013

bellincm - Fri Jun 14 14:43:03 EDT 2013

I need some more help with this code.   The help that I need is still with the placement of the objects when they are created. I want the new objects to be created under the first instance of the heading where the Use Case ID matches with the new Use Case ID. Any thoughts?  Again, it's been a while since I've had to modify DXL code.

You can create an object to be the first (top) object in the module.  Otherwise you can only create an object relative to some other object; either

  • before     (at same level)
  • after         (as same level)
  • first below   (becomes 1st child)
  • last below   (becomes last child)

so you need to keep a Handle on where you want the new object.  That obviously is the object that is the "heading where the Use Case ID matches".  That important information my qualify as a global variable.  I'm pretty sure you want to create new objects always "last below" that object.

"move" after "create" doesn't help, since "move" likewise requires you to know exactly where you want it so you might as well just create it where you want it rather than adding a level of confusion.

-Louie